package cn.zyjw.feign;

import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "authorization-server", fallbackFactory = Oauth2ServerFallBackFactory.class)
public interface OAuth2FeignClient {

    @PostMapping("/oauth/token")
    Response getJwtToken(
            @RequestParam("grant_type") String grantType,//password 密码方式登录
            @RequestParam("username") String username,
            @RequestParam("password") String password,
            @RequestParam("login_type") String loginType,//admin_type 管理员登录
            @RequestHeader("Authorization") String clientToken
    );

}
